﻿using System.Configuration;
using System.IO;
using System.Windows.Forms;
using DataScripter.XmlInterpreter;

namespace DataScripter.UI
{
    public partial class DataScripterForm : Form
    {
        public DataScripterForm()
        {
            InitializeComponent();
            string scriptFilename = ConfigurationManager.AppSettings["Script"];
            scriptTextBox.Text = File.ReadAllText(scriptFilename);
        }

        private void ScriptButtonClick(object sender, System.EventArgs e)
        {
            XmlEngineConfiguration configuration = new XmlEngineConfiguration(scriptTextBox.Text);
            configuration.Run();
        }
    }
}
